import request from '@/utils/request'

export function listGoods(data) {
  return request({
    url: '/product/queryByPage',
    method: 'post',
    data
  })
}

export function deleteGoods(pid) {
  return request({
    url: '/product/deleteById',
    method: 'get',
    params: {
      pid
    }
  })
}

export function publishGoods(data) {
  return request({
    url: '/product/addOrUpdate',
    method: 'post',
    data
  })
}

export function detailGoods(id) {
  return request({
    url: '/goods/detail',
    method: 'get',
    params: {
      id
    }
  })
}

export function editGoods(data) {
  return request({
    url: '/product/addOrUpdate',
    method: 'post',
    data
  })
}

export function getDetailInfo(query) {
  return request({
    url: '/product/queryById',
    method: 'get',
    params: query
  })
}
